public class PlayerAIState_BaseLine : State<PlayerAI>
{
	public static PlayerAIState_BaseLine instance;

	private PlayerAIState_BaseLine()
	{
	}

	public static PlayerAIState_BaseLine getInstance()
	{
		if (instance == null)
		{
			instance = new PlayerAIState_BaseLine();
		}
		return instance;
	}

	public override void enter(PlayerAI owner)
	{
		base.enter(owner);
		owner.player.dribblerun_is_charging = false;
	}

	public override void fixedUpdate(PlayerAI owner)
	{
		base.fixedUpdate(owner);
		if (Instance<Ball>.instance.isInState(BallState_Idle.getInstance()) || Instance<Ball>.instance.isInState(BallState_Rebound.getInstance()))
		{
			GameHelper.MoveTo(owner.player, MathHelper.setY(Instance<Ball>.instance.getPosition(), 0f), owner.player.getMoveSpeed(), isLookAtTargetPos: true);
			owner.player.do_run();
			if (MathHelper.getSqrDistance_vec2(owner.player.getPosition(), MathHelper.setY(Instance<Ball>.instance.getPosition(), 0f)) < 1.2f)
			{
				owner.player.do_dribble_run();
			}
		}
		else
		{
			if (!Instance<Ball>.instance.isInState(BallState_Dribble_Run.getInstance()))
			{
				return;
			}
			if (MathHelper.getSqrDistance(owner.player.getPosition(), owner.player.bassline_targetPos) < 4f)
			{
				if (GameHelper.MoveTo(owner.player, owner.player.bassline_targetPos, owner.player.getMoveSpeed(), isLookAtTargetPos: false) && !owner.player.IsInvoking("do_baseline"))
				{
					owner.player.do_dribble_stay();
					owner.player.LookAtSmooth(owner.player.team.getPlayer_ClosestTeammate(owner.player).getPosition());
					owner.player.Invoke("do_baseline", 1f);
				}
				owner.player.LookAtSmooth(owner.player.team.getPlayer_ClosestTeammate(owner.player).getPosition());
			}
			else if (GameHelper.MoveTo(owner.player, owner.player.bassline_targetPos, owner.player.getMoveSpeed(), isLookAtTargetPos: true) && !owner.player.IsInvoking("do_baseline"))
			{
				owner.player.do_dribble_stay();
				owner.player.LookAtSmooth(owner.player.team.getPlayer_ClosestTeammate(owner.player).getPosition());
				owner.player.Invoke("do_baseline", 1f);
			}
		}
	}
}
